﻿<%@ Page Title="" Language="C#" MasterPageFile="~/subpage.master" AutoEventWireup="true" CodeBehind="myhomepage.aspx.cs" Inherits="Nhom14_HTTTHD_BuyMe.myhomepage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    
<h3>My Website to sell</h3>
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" DataKeyNames="id" CellPadding="4" 
        ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" 
                SortExpression="id" InsertVisible="False" ReadOnly="True" />
            <asp:BoundField DataField="site_name" HeaderText="Site Name" 
                SortExpression="site_name" />
            <asp:BoundField DataField="site_url" HeaderText="site_url" 
                SortExpression="site_url" />
            <asp:BoundField DataField="asking_price" HeaderText="Price" 
                SortExpression="asking_price" />
            <asp:BoundField DataField="date_started" HeaderText="Date Started" 
                SortExpression="date_started" />
            <asp:BoundField DataField="bids" HeaderText="Bids" ReadOnly="True" 
                SortExpression="bids" />
            <asp:HyperLinkField DataNavigateUrlFields="id" 
                DataNavigateUrlFormatString="details.aspx?id={0}" HeaderText="Details" 
                Target="_blank" Text="details" />
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <SortedAscendingCellStyle BackColor="#FDF5AC" />
        <SortedAscendingHeaderStyle BackColor="#4D0000" />
        <SortedDescendingCellStyle BackColor="#FCF6C0" />
        <SortedDescendingHeaderStyle BackColor="#820000" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:WebsitebrokenConnection %>" 
        
        SelectCommand="SELECT website.id, website.site_name, website.timestamp, website.asking_price, website.date_started, website.site_url, COUNT(bid_website.id) AS bids FROM website INNER JOIN website_status ON website.id_website_status = website_status.id INNER JOIN bid_website ON website.id = bid_website.id_website WHERE (website.id_account = @id_account) AND (website.status = 1) GROUP BY website.id, website.site_name, website.timestamp, website.asking_price, website.date_started, website.site_url">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="id_account" SessionField="user" />
        </SelectParameters>
    </asp:SqlDataSource>
<h3>My Domain to sell</h3>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="id" DataSourceID="SqlDataSource2" CellPadding="4" 
        ForeColor="#333333" GridLines="None" ShowHeaderWhenEmpty="True">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
            <asp:BoundField DataField="domain_url" HeaderText="Url" 
                SortExpression="domain_url" />
            <asp:BoundField DataField="page_view" HeaderText="Page views" 
                SortExpression="page_view" />
            <asp:BoundField DataField="asking_price" HeaderText="Price" 
                SortExpression="asking_price" />
            <asp:BoundField DataField="date_started" HeaderText="Date Started" 
                SortExpression="date_started" />
            <asp:BoundField DataField="bids" HeaderText="bids" ReadOnly="True" 
                SortExpression="bids" />
            <asp:HyperLinkField DataNavigateUrlFields="id" 
                DataNavigateUrlFormatString="detaildomain.aspx?id={0}" HeaderText="Details" 
                Target="_blank" Text="details" />
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <SortedAscendingCellStyle BackColor="#FDF5AC" />
        <SortedAscendingHeaderStyle BackColor="#4D0000" />
        <SortedDescendingCellStyle BackColor="#FCF6C0" />
        <SortedDescendingHeaderStyle BackColor="#820000" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:WebsitebrokenConnection %>" 
        
        
        SelectCommand="SELECT domain.id, domain.domain_url, domain.timestamp, domain.page_view, domain.asking_price, domain.date_started, COUNT(bid_domain.id) AS bids FROM domain INNER JOIN bid_domain ON domain.id = bid_domain.id_domain WHERE (domain.id_account = @id_account) AND (domain.status = 1) GROUP BY domain.id, domain.domain_url, domain.timestamp, domain.page_view, domain.asking_price, domain.date_started">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="id_account" SessionField="user" />
        </SelectParameters>
    </asp:SqlDataSource>

</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="SidebarContent" runat="server">

    <div class="account">
        <h2>
            My Account</h2>
        <ul>
            <li><a href="myhomepage.aspx">My Websites-Domain</a></li>
            <li><a href="mybid.aspx">My Bibs</a></li>
            <li><a href="mytransaction.aspx">My Transaction</a></li>
            <li><a href="mymessage.aspx">My Messages</a></li>
        </ul>
    </div>
</asp:Content>
